# ------------------------------------------------------------------------------#
#	Paper:			Local Effects of Foreign Direct Investment
#	Authors:		Tobias Rommel, Tabea Palmtag, Luca Messerschmidt
#	Version:		January 29, 2025
#	Data:			  FDI projects, nightlights data, V-Dem data
#	Task:			  Treatment matching analysis
# ------------------------------------------------------------------------------#
# Matching Methods for Causal Inference with Time-Series Cross-Sectional Data (Kosuke Imai, In Song Kim, and Erik H. Wang)
# Please note that this code was running for several hours on a cloud computer of the Leibniz Supercomputing Centre.
# Errors in estimating these models with a normal computer might occur and the process might be aborted due to memory exhaustion.
# Load Packages
library(sf)
library(tidyverse)
library(countrycode)
library(dplyr)
library(stars)
library(haven)
library(readr)
library(PanelMatch)
rm(list=ls())
setwd("/Users/tobiasrommel/Dropbox/06 Forschung/FDIgrowth-Project/RPM_FDIgrowth_Replication/")
## Figure 5
dat <- readRDS("FDIgrowth_both_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1, `Grid Size`= "10km") %>% rename("low"=3,"up"=4)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = `Grid Size`)) +
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("All countries") +
xlab("") +
ggtitle("Growth Estimates (ATT)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "bottom")
## Figure 6
dat <- readRDS("FDIspatial_both_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1, `Grid Size`= "25km") %>% rename("low"=3,"up"=4)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = `Grid Size`)) +
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("All countries") +
xlab("") +
ggtitle("Growth Estimates (ATT)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "bottom")
## Figure A-3
aut <- readRDS("FDIgrowth_aut_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1,  Type = "Authocracies") %>% rename("low"=3,"up"=4)
dem <- readRDS("FDIgrowth_dem_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1,  Type = "Democracies") %>% rename("low"=3,"up"=4)
dat <- bind_rows(aut, dem)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = Type)) +  # Use Type for different colors
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2
) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("10km") +
xlab("") +
ggtitle("Growth Estimates (ATT)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "bottom", legend.title = element_blank())
## Figure A-4
aut <- readRDS("FDIspatial_aut_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1,  Type = "Autocracies") %>% rename("low"=3,"up"=4)
dem <- readRDS("FDIspatial_dem_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1,  Type = "Democracies") %>% rename("low"=3,"up"=4)
dat <- bind_rows(aut, dem)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = Type)) +  # Use Type for different colors
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2
) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("10km") +
xlab("") +
ggtitle("Inequality Estimates (ATT)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "bottom", legend.title = element_blank())
# Plot
ggplot(dat, aes(x = year, y = estimate, color = Type)) +  # Use Type for different colors
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2
) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("10km") +
xlab("") +
ggtitle("Growth Estimates (ATT)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "bottom", legend.title = element_blank())
## Figure 6
dat <- readRDS("FDIspatial_both_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1, `Grid Size`= "25km") %>% rename("low"=3,"up"=4)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = `Grid Size`)) +
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("All countries") +
xlab("") +
ggtitle("Growth Estimates (ATT)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "bottom")
## Figure 5
dat <- readRDS("FDIgrowth_both_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1, `Grid Size`= "10km") %>% rename("low"=3,"up"=4)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = `Grid Size`)) +
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("Coefficient Estimate") +
xlab("") +
ggtitle("Nightlight Intensity, Unconditional (10x10km)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend = "none")
## Figure 5
dat <- readRDS("FDIgrowth_both_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1, `Grid Size`= "10km") %>% rename("low"=3,"up"=4)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = `Grid Size`)) +
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("Coefficient Estimate") +
xlab("") +
ggtitle("Nightlight Intensity, Unconditional (10x10km)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "none")
## Figure 6
dat <- readRDS("FDIspatial_both_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1, `Grid Size`= "25km") %>% rename("low"=3,"up"=4)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = `Grid Size`)) +
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("Coefficient Estimate") +
xlab("") +
ggtitle("Nightlight Intensity, by Regime Type (10x10km)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "none")
## Figure A-4
aut <- readRDS("FDIspatial_aut_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1,  Type = "Autocracies") %>% rename("low"=3,"up"=4)
dem <- readRDS("FDIspatial_dem_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1,  Type = "Democracies") %>% rename("low"=3,"up"=4)
dat <- bind_rows(aut, dem)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = Type)) +  # Use Type for different colors
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2
) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("Coefficient Estimate") +
xlab("") +
ggtitle("Nightlight Inequality, by Regime Type (25x25km)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "bottom", legend.title = element_blank())
# Figure A-4
aut <- readRDS("FDIspatial_aut_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1,  Type = "Autocracies") %>% rename("low"=3,"up"=4)
dem <- readRDS("25_dem_ps_match_3_5_5.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1,  Type = "Democracies") %>% rename("low"=3,"up"=4)
dat <- bind_rows(aut, dem)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = Type)) +  # Use Type for different colors
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2
) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("Coefficient Estimate") +
xlab("") +
ggtitle("Nightlight Inequality, by Regime Type (25x25km)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "bottom", legend.title = element_blank())
# ------------------------------------------------------------------------------#
#	Paper:			Local Effects of Foreign Direct Investment
#	Authors:		Tobias Rommel, Tabea Palmtag, Luca Messerschmidt
#	Version:		January 29, 2025
#	Data:			  FDI projects, nightlights data, V-Dem data
#	Task:			  Treatment matching analysis
# ------------------------------------------------------------------------------#
# Matching Methods for Causal Inference with Time-Series Cross-Sectional Data (Kosuke Imai, In Song Kim, and Erik H. Wang)
# Please note that this code was running for several hours on a cloud computer of the Leibniz Supercomputing Centre.
# Errors in estimating these models with a normal computer might occur and the process might be aborted due to memory exhaustion.
## Load Packages
library(sf)
library(tidyverse)
library(countrycode)
library(dplyr)
library(stars)
library(haven)
library(readr)
library(PanelMatch)
## Directory
rm(list=ls())
setwd("/Users/tobiasrommel/Dropbox/06 Forschung/FDIgrowth-Project/RPM_FDIgrowth_Replication/")
## Figure 5
dat <- readRDS("FDIgrowth_both_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1, `Grid Size`= "10km") %>% rename("low"=3,"up"=4)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = `Grid Size`)) +
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("Coefficient Estimate") +
xlab("") +
ggtitle("Nightlight Intensity, Unconditional (10x10km)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "none")
ggsave("Figure5.eps", device = "eps", width = 6, height = 4, dpi = 300)
## Figure 5
dat <- readRDS("FDIgrowth_both_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1, `Grid Size`= "10km") %>% rename("low"=3,"up"=4)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = `Grid Size`)) +
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("Coefficient Estimate") +
xlab("") +
ggtitle("Nightlight Intensity, Unconditional (10x10km)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "none")
ggsave("Figure5.png", width = 6, height = 4, dpi = 300)
## Figure 5
dat <- readRDS("FDIgrowth_both_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1, `Grid Size`= "10km") %>% rename("low"=3,"up"=4)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = `Grid Size`)) +
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("Coefficient Estimate") +
xlab("") +
ggtitle("Nightlight Intensity, Unconditional (10x10km)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "none")
ggsave("Figure5.eps", width = 6, height = 4, dpi = 300)
## Figure 6
dat <- readRDS("FDIspatial_both_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1, `Grid Size`= "25km") %>% rename("low"=3,"up"=4)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = `Grid Size`)) +
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("Coefficient Estimate") +
xlab("") +
ggtitle("Nightlight Intensity, by Regime Type (10x10km)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "none")
ggsave("Figure6.epng", width = 6, height = 4, dpi = 300)
## Figure 6
dat <- readRDS("FDIspatial_both_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1, `Grid Size`= "25km") %>% rename("low"=3,"up"=4)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = `Grid Size`)) +
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("Coefficient Estimate") +
xlab("") +
ggtitle("Nightlight Intensity, by Regime Type (10x10km)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "none")
ggsave("Figure6.png", width = 6, height = 4, dpi = 300)
# ------------------------------------------------------------------------------#
#	Paper:			Local Effects of Foreign Direct Investment
#	Authors:		Tobias Rommel, Tabea Palmtag, Luca Messerschmidt
#	Version:		January 29, 2025
#	Data:			  FDI projects, nightlights data, V-Dem data
#	Task:			  Treatment matching analysis
# ------------------------------------------------------------------------------#
# Matching Methods for Causal Inference with Time-Series Cross-Sectional Data (Kosuke Imai, In Song Kim, and Erik H. Wang)
# Please note that this code was running for several hours on a cloud computer of the Leibniz Supercomputing Centre.
# Errors in estimating these models with a normal computer might occur and the process might be aborted due to memory exhaustion.
## Load Packages
library(sf)
library(tidyverse)
library(countrycode)
library(dplyr)
library(stars)
library(haven)
library(readr)
library(PanelMatch)
## Directory
rm(list=ls())
setwd("/Users/tobiasrommel/Dropbox/06 Forschung/FDIgrowth-Project/RPM_FDIgrowth_Replication/")
# ------------------------------------------------------------------------------#
### Treatment Matching Graphs, based on previous estimates (see below)
## Figure 5
dat <- readRDS("FDIgrowth_both_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1, `Grid Size`= "10km") %>% rename("low"=3,"up"=4)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = `Grid Size`)) +
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("Coefficient Estimate") +
xlab("") +
ggtitle("Nightlight Intensity, Unconditional (10x10km)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "none")
ggsave("Figure5.eps", width = 6, height = 4, dpi = 300)
## Figure 6
dat <- readRDS("FDIspatial_both_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1, `Grid Size`= "25km") %>% rename("low"=3,"up"=4)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = `Grid Size`)) +
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("Coefficient Estimate") +
xlab("") +
ggtitle("Nightlight Inequality, Unconditional (25x25km)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "none")
ggsave("Figure6.png", width = 6, height = 4, dpi = 300)
## Figure A-3
aut <- readRDS("FDIgrowth_aut_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1,  Type = "Autocracies") %>% rename("low"=3,"up"=4)
dem <- readRDS("FDIgrowth_dem_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1,  Type = "Democracies") %>% rename("low"=3,"up"=4)
dat <- bind_rows(aut, dem)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = Type)) +  # Use Type for different colors
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2
) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("Coefficient Estimate") +
xlab("") +
ggtitle("Nightlight Intensity, by Regime Type (10x10km)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "bottom", legend.title = element_blank())
ggsave("FigureA3.png", width = 6, height = 4, dpi = 300)
## Figure A-4
aut <- readRDS("FDIspatial_aut_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1,  Type = "Autocracies") %>% rename("low"=3,"up"=4)
dem <- readRDS("FDIspatial_dem_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1,  Type = "Democracies") %>% rename("low"=3,"up"=4)
dat <- bind_rows(aut, dem)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = Type)) +  # Use Type for different colors
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2
) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("Coefficient Estimate") +
xlab("") +
ggtitle("Nightlight Inequality, by Regime Type (25x25km)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "bottom", legend.title = element_blank())
ggsave("FigureA4.png", width = 6, height = 4, dpi = 300)
## Figure 5
dat <- readRDS("FDIgrowth_both_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1, `Grid Size`= "10km") %>% rename("low"=3,"up"=4)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = `Grid Size`)) +
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("Coefficient Estimate") +
xlab("") +
ggtitle("Nightlight Intensity, Unconditional (10x10km)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "none")
ggsave("Figure5.png", width = 6, height = 4, dpi = 300)
# ------------------------------------------------------------------------------#
#	Paper:			Local Effects of Foreign Direct Investment
#	Authors:		Tobias Rommel, Tabea Palmtag, Luca Messerschmidt
#	Version:		January 29, 2025
#	Data:			  FDI projects, nightlights data, V-Dem data
#	Task:			  Treatment matching analysis
# ------------------------------------------------------------------------------#
# Matching Methods for Causal Inference with Time-Series Cross-Sectional Data (Kosuke Imai, In Song Kim, and Erik H. Wang)
# Please note that this code was running for several hours on a cloud computer of the Leibniz Supercomputing Centre.
# Errors in estimating these models with a normal computer might occur and the process might be aborted due to memory exhaustion.
## Load Packages
library(sf)
library(tidyverse)
library(countrycode)
library(dplyr)
library(stars)
library(haven)
library(readr)
library(PanelMatch)
## Directory
rm(list=ls())
setwd("/Users/tobiasrommel/Dropbox/06 Forschung/FDIgrowth-Project/RPM_FDIgrowth_Replication/")
# ------------------------------------------------------------------------------#
### Treatment Matching Graphs, based on previous estimates (see below)
## Figure 5
dat <- readRDS("FDIgrowth_both_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1, `Grid Size`= "10km") %>% rename("low"=3,"up"=4)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = `Grid Size`)) +
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("Coefficient Estimate") +
xlab("") +
ggtitle("Nightlight Intensity, Unconditional (10x10km)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "none")
ggsave("Figure5.eps", width = 6, height = 4, dpi = 300)
## Figure 6
dat <- readRDS("FDIspatial_both_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1, `Grid Size`= "25km") %>% rename("low"=3,"up"=4)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = `Grid Size`)) +
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("Coefficient Estimate") +
xlab("") +
ggtitle("Nightlight Inequality, Unconditional (25x25km)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "none")
ggsave("Figure6.eps", width = 6, height = 4, dpi = 300)
## Figure A-3
aut <- readRDS("FDIgrowth_aut_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1,  Type = "Autocracies") %>% rename("low"=3,"up"=4)
dem <- readRDS("FDIgrowth_dem_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1,  Type = "Democracies") %>% rename("low"=3,"up"=4)
dat <- bind_rows(aut, dem)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = Type)) +  # Use Type for different colors
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2
) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("Coefficient Estimate") +
xlab("") +
ggtitle("Nightlight Intensity, by Regime Type (10x10km)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "bottom", legend.title = element_blank())
ggsave("FigureA3.eps", width = 6, height = 4, dpi = 300)
## Figure A-4
aut <- readRDS("FDIspatial_aut_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1,  Type = "Autocracies") %>% rename("low"=3,"up"=4)
dem <- readRDS("FDIspatial_dem_all.Rds") %>% slice(1:3) %>% dplyr::mutate(year = row_number()-1,  Type = "Democracies") %>% rename("low"=3,"up"=4)
dat <- bind_rows(aut, dem)
# Plot
ggplot(dat, aes(x = year, y = estimate, color = Type)) +  # Use Type for different colors
geom_errorbar(
aes(ymin = low, ymax = up),
position = position_dodge(0.3), width = 0.2
) +
geom_point(position = position_dodge(0.3)) +
scale_x_continuous(breaks = c(0, 1, 2)) +
ylab("Coefficient Estimate") +
xlab("") +
ggtitle("Nightlight Inequality, by Regime Type (25x25km)") +
theme_light() +
geom_hline(yintercept = 0, color = "darkgrey", size = 0.5) +
theme(legend.position = "bottom", legend.title = element_blank())
ggsave("FigureA4.eps", width = 6, height = 4, dpi = 300)
